package com.ayuan.blog.controller;

import com.ayuan.blog.bean.CommonResponseBean;
import com.ayuan.blog.bean.TagInfo;
import com.ayuan.blog.service.ArticleTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by xiaozhu on 16/8/15.
 */
@Controller
@RequestMapping("tag")
public class TagController extends BaseController {

    @Autowired
    private ArticleTagService articleTagService;

    @RequestMapping(value = "list", method = RequestMethod.POST)
    @ResponseBody
    public Object list(Integer limit) {
        List<TagInfo> tagInfoList = articleTagService.findTagInfoList(limit);

        return new CommonResponseBean<List>(0, "", tagInfoList);
    }
}
